<!doctype html>
<html class="no-js">
<?php include dirname(__FILE__).'/../head.php';?>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->

<?php include dirname(__FILE__).'/../header.php';?>

<div class="am-cf admin-main">
  <!-- sidebar start -->
 	<?php include dirname(__FILE__).'/../sidebar.php';?>
  <!-- sidebar end -->

  <!-- content start -->
  <div class="admin-content">
    <div class="am-cf am-padding">
      <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">活动管理</strong> / <small>新增活动</small></div>
    </div>

    <hr/>

    <div class="am-g">
	<form class="am-form am-form-horizontal" method="post" enctype="multipart/form-data" action="<?php echo U('Activity/addActivity')?>">
      <div class="am-u-sm-12 am-u-md-4 am-u-md-push-8">
        <div class="am-panel am-panel-default">
          <div class="am-panel-bd">
            <div class="am-g">
              <div class="am-u-md-4">
                <img class="am-img-circle am-img-thumbnail" id="prew" src="<?php echo __ROOT__?>/Public/amaze/assets/img/512.png" alt="" name="prew"/>
              </div>
              <div class="am-u-md-8">
                <p>你好，请上传教师头像，使用192*225px的照片，这样显得更牛逼！！！ </p>
                  <div class="am-form-group">
                    <input type="file" id="pic" name="pic">
                    <p class="am-form-help">请选择要上传的文件...</p>
                  </div>
              </div>
            </div>
          </div>
        </div>

<!--         <div class="am-panel am-panel-default"> -->
<!--           <div class="am-panel-bd"> -->
<!--             <div class="user-info"> -->
<!--               <p>等级信息</p> -->
<!--               <div class="am-progress am-progress-sm"> -->
                <div class="am-progress-bar" style="width: 60%"></div>
<!--               </div> -->
<!--               <p class="user-info-order">当前等级：<strong>LV8</strong> 活跃天数：<strong>587</strong> 距离下一级别：<strong>160</strong></p> -->
<!--             </div> -->
<!--             <div class="user-info"> -->
<!--               <p>信用信息</p> -->
<!--               <div class="am-progress am-progress-sm"> -->
                <div class="am-progress-bar am-progress-bar-success" style="width: 80%"></div>
<!--               </div> -->
<!--               <p class="user-info-order">信用等级：正常当前 信用积分：<strong>80</strong></p> -->
<!--             </div> -->
<!--           </div> -->
<!--         </div> -->

      </div>

      <div class="am-u-sm-12 am-u-md-8 am-u-md-pull-4">
          <div class="am-form-group">
            <label for="name" class="am-u-sm-3 am-form-label">活动名称</label>
            <div class="am-u-sm-5 am-u-end">
              <input type="text" id="name"  name="name" placeholder="活动名称" >
              <small>活动叫什么名字，必须填！！！！！</small>
            </div>
          </div>

          <div class="am-form-group">
            <label for="level" class="am-u-sm-3 am-form-label">教师名称</label>
            <div class="am-u-sm-9">
	            <div class="am-btn-group" data-am-button>
	            <?php
          			foreach ($js as $s){
         		 ?>
	              <label class="am-btn am-btn-default am-btn-xs" name="sl">
	                <input type="radio" name="teacher" value="<?php echo $s['id'];?>" id="<?php echo "teacher".$s['id'];?>"> 
	                	<?php echo $s['name']?>
	              </label>
	              <?php }?>
	          </div>
            </div>
          </div>
        <!--<div class="am-form-group" id="term2">
			<label for="academy" class="am-u-sm-3 am-form-label" >专业(选填)</label>
			<div id="yx_contain" class="am-btn-group" data-am-button></div>
		</div>-->
		<div class="am-form-group">
			      <label for="" class="am-u-sm-3 am-form-label">期数</label>
			      <div class="am-u-sm-6 am-u-end">
				    <input type="number" id="term" name="term"
 placeholder="期数"  maxlength="15"> <small>示例：只填数字就可以了，不许填数字以外的东西(｡•ˇ‸ˇ•｡)</small>
			</div>
		</div>
		<div class="am-form-group">
			      <label for="" class="am-u-sm-3 am-form-label">活动时间</label>
			      <div class="am-u-sm-6 am-u-end">
				    <input type="text" id="time" name="time"
 placeholder="活动时间"  maxlength="15"> <small>示例:跟着我的队形走,2016.01.01（星期五）o(〃'▽'〃)o星期不写也可以</small>
 						</div>
		</div>
		<!--<div class="am-form-group">
			      <label for="" class="am-u-sm-3 am-form-label">活动状态</label>
			      <div class="am-u-sm-6 am-u-end">
				    <input type="text" id="status" name="status"
 placeholder="活动状态"  maxlength="15"> <small>示例:1是正常2是结束，必须选一个<(￣ˇ￣)/</small>
						</div>
		</div>-->
		<div class="am-form-group">
			      <label for="" class="am-u-sm-3 am-form-label">活动补充（选填）</label>
			      <div class="am-u-sm-6 am-u-end">
				    <input type="text" id="other1" name="other1"
 placeholder="活动补充"  maxlength="150"> <small>示例:1.即兴评述注意事项</small>
						</div>
		</div>
		<div class="am-form-group">
			      <label for="" class="am-u-sm-3 am-form-label">活动补充第二条（选填）</label>
			      <div class="am-u-sm-6 am-u-end">
				    <input type="text" id="other2" name="other2"
 placeholder="活动补充第二条"  maxlength="150"> <small>示例:2.实例讲解评书技巧</small>
						</div>
		</div>
		<div class="am-form-group">
			      <label for="" class="am-u-sm-3 am-form-label">活动补充第三条（选填）</label>
			      <div class="am-u-sm-6 am-u-end">
				    <input type="text" id="other3" name="other3"
 placeholder="活动补充第三条"  maxlength="150"> <small>示例:3.现场互动环节，嘉宾为大家答疑解惑</small>
						</div>
		</div>
		<div class="am-form-group" id="description">
            <label for="description" class="am-u-sm-3 am-form-label">活动描述（选填）</label>
            <div class="am-u-sm-6 am-u-end">
              <input type="text" id="description"  name="description" placeholder="活动描述" maxlength="150">
               <small>示例：现场互动环节还有嘉宾为大家答疑解惑和实例讲解评书技巧（反正就是总结一段话，不用分条写就对啦）</small>
            </div>
    </div>
         
		
    <div class="am-form-group">
            <div class="am-u-sm-9 am-u-sm-push-3">
              <button type="submit" class="am-btn am-btn-primary">保存修改</button>
            </div>
          </div>
    </div>
      </form>
    </div>
  </div>
  <!-- content end -->

</div>

<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

<footer>
  <hr>
  <p class="am-padding-left">© 2014 AllMobilize, Inc. Licensed under MIT license.</p>
</footer>

<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="<?php echo __ROOT__?>/Public/amaze/assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="<?php echo __ROOT__?>/Public/amaze/assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="<?php echo __ROOT__?>/Public/amaze/assets/js/amazeui.min.js"></script>

<script src="<?php echo __ROOT__?>/Public/amaze/assets/js/app.js"></script>
<script charset="utf-8" src="<?php echo __ROOT__?>/Public/amaze/editor/kindeditor.js"></script>
<script charset="utf-8" src="<?php echo __ROOT__?>/Public/amaze/editor/lang/zh_CN.js"></script>
<script type="text/javascript">
	$(function(){
	  $("#belong1").change(function(){
	  	$("#institutionDiv").show();
	  });
	  $("#belong2").change(function(){
	    $("#institutionDiv").hide();
	   });
	});

	
	$("button#searchButton").click(function(){
		var key=$("#searchKey").val();
		window.location.href="<?php echo U('Activity/searchTeacher');?>?key="+key;
	});
	
	document.querySelector('#pic').addEventListener('change', function(){
	    var reader = new FileReader();
	    reader.onload = function(e) {
	        document.querySelector('#prew').src = e.target.result;
	    }
	    reader.readAsDataURL(this.files[0]);
	});
	
</script>
<script>
	$("[name=sl]").click(function(){
		var sid=$(this).find("input").val();
		var department = <?php echo $department;?>;
		//console.log(department);
		$("#yx_contain").empty();
		var string = '<label class="am-btn am-btn-default am-btn-xs"><input  type="radio" name="department" value=""> </label>';
  		
		for(var i in department){
			if(department[i].sid==sid){
				var a = $(string);
				var input=a.find("input");
				input.val(department[i].did);
				a.text(department[i].name);
				a.append(input);
				$("#yx_contain").append(a);
			}
		}
		
	   
	});
</script>
</body>
</html>
